package com.shqcjd.yunweiyanoperator.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.shqcjd.yunweiyanoperator.R;
import com.shqcjd.yunweiyanoperator.model.pojo.ExpertBean;
import com.shqcjd.yunweiyanoperator.model.pojo.StaffManageBean;

import java.util.List;

public class BusinessExpertAdapter extends BaseQuickAdapter<ExpertBean.ListBean, BusinessExpertAdapter.ViewHolder> {

    public BusinessExpertAdapter() {
        super(R.layout.item_business_expert);
    }

    @Override
    protected void convert(ViewHolder helper, ExpertBean.ListBean item) {
        helper.tv_business_expert_phone.setText(item.phoneNumber+(item.businessName.equals("")?"":"("+item.businessName+")"));
        helper.tv_business_expert_name.setText(item.userName);
        helper.tv_business_expert_tag.setText(item.userName.substring(0, 1));
    }

    class ViewHolder extends BaseViewHolder {
        TextView tv_business_expert_phone, tv_business_expert_name, tv_business_expert_tag;
        public ViewHolder(View view) {
            super(view);
            tv_business_expert_phone = view.findViewById(R.id.tv_business_expert_phone);
            tv_business_expert_name = view.findViewById(R.id.tv_business_expert_name);
            tv_business_expert_tag = view.findViewById(R.id.tv_business_expert_tag);
        }
    }
}
